<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>打乱数组内元素的排序</title>

</head>

<body>

</body>
<script>
  "use strict"; {
    let students = ["小红", "李白", "亚瑟", "周瑜", "小乔", "貂蝉", "吕布"];
    let index;
    for (let point = students.length - 1; point >= 0; point--) {
      index = Math.floor(Math.random() * point);
      [students[index], students[point]] = [students[point], students[index]];
    };
    console.table(students);
  };
</script>

</html>